home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / wemdemo4.zip / INFO / TEXINFO.1 (.txt) < prev    next >
GNU Info File  |  1994-09-21  |  50KB  |  955 lines

  1. This is Info file ../info/texinfo, produced by Makeinfo-1.55 from the
  2. input file texinfo.txi.
  3.    This file documents Texinfo, a documentation system that uses a
  4. single source file to produce both on-line help and a printed manual.
  5.    This is edition 1.1 of the Texinfo documentation, and is for the
  6. Texinfo that is distributed as part of Version 18 of GNU Emacs.
  7.    Copyright (C) 1988 Free Software Foundation, Inc.
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.    Permission is granted to copy and distribute modified versions of
  12. this manual under the conditions for verbatim copying, provided that
  13. the entire resulting derived work is distributed under the terms of a
  14. permission notice identical to this one.
  15.    Permission is granted to copy and distribute translations of this
  16. manual into another language, under the above conditions for modified
  17. versions, except that this permission notice may be stated in a
  18. translation approved by the Foundation.
  19. File: texinfo,  Node: Top,  Next: License,  Prev: (dir),  Up: (dir)
  20. * Menu:
  21. * License::            Licensing information.
  22. * Overview::            What is Texinfo?
  23. * Texinfo Mode::        Special features in GNU Emacs.
  24. * Beginning a File::         What to put at the beginning of a Texinfo file.
  25. * Ending a File::         What to put at the end of a Texinfo file.
  26. * Structuring::             How to make nodes and chapters.
  27. * Quotations and Examples::    How to insert quotations and examples.
  28. * Lists and Tables::         How to make lists and tables.
  29. * Cross References::         How to make cross references.
  30. * Formatting Paragraphs::    How to format paragraphs.
  31. * Marking Text::         How to mark code, definitions, variables etc.
  32. * Conditionals::         Putting text in only Info or the printed work.
  33. * Printing Hardcopy::         How to print a hardcopy of the manual.
  34. * Creating an Info File::    How to create an on-line Info file.
  35. * Catching Mistakes::        How to find problems.
  36. Indices, nodes containing large menus
  37. * Command Index::         An item for each @-command.
  38. * Concept Index::          An item for each concept.
  39. A detailed node listing
  40. Overview
  41. * Info File::            Characteristics of the Info file.
  42. * Printed Manual::        Characteristics of the printed manual.
  43. * Conventions::            General syntactic conventions.
  44. * Short Sample::            A short sample Texinfo file.
  45. Using Texinfo Mode
  46. * Info on a Region::        Formatting a region for Info.
  47. * Showing the Structure::    Showing the structure of a file.
  48. * Inserting::            Inserting frequently used commands.
  49. Beginning a Texinfo File.
  50. * First Line::            The first line of a Texinfo file.
  51. * Start-of-Header::        Identifying the start of the header.
  52. * Setfilename::            Specifying the name of the Info file.
  53. * Settitle::            Specifying the title used by the headings.
  54. * Setchapternewpage::        Starting chapters on odd numbered pages.
  55. * Titlepage::            The title and copyright page.
  56. * Center::            Centering a line.
  57. * Copyright & Printed Permissions:: Ensuring free distributability.
  58. * Top Node::            The master menu.
  59. * License and Distribution::    Your are free to copy and distribute this.
  60. Ending a Texinfo File
  61. * Contents::            Generating tables of contents.
  62. * Indices::            Generating indices.
  63. * Index Entries::        Defining the entries of an index.
  64. * Combining Indices::        Putting two or more indices together.
  65. * Printing Indices & Menus::    Printing an index and generating menus.
  66. Node and Chapter Structuring
  67. * Chapter::            Creating a chapter.
  68. * Unnumbered and Appendix::    Chapter-like parts.
  69. * Section::            Creating sections
  70. * Subsection::            Creating subsections.
  71. * Subsubsection::        Creating subsubsections.
  72. * Node::            Creating nodes.
  73. * Menu::            Creating menus.
  74. Making quotations and examples
  75. * Quotation::            Inserting long quotations.
  76. * Example::            Inserting examples of code and the like.
  77. * Display::            Inserting displayed text.
  78. Making lists and two column tables
  79. * Itemize::            Creating itemized lists.
  80. * Enumerate::            Creating enumerated lists.
  81. * Table::            Creating two column tables.
  82. * Itemx::            Putting an extra item in the
  83.                 first column of a table.
  84. Making Cross References
  85. * Xref::            Making a regular cross reference.
  86. * Pxref::            Making a parenthetical cross reference.
  87. * Inforef::            Making a cross reference to an Info file.
  88. Formatting Paragraphs
  89. * Refilling & Noindent::    Refilling paragraphs
  90.                 and preventing indentation
  91. * Refill::            Using the `@refill' command.
  92. * Noindent::            Using the `@noindent' command.
  93. Breaks, Blank Lines and Groups
  94. * Line Breaks::            Inserting line breaks in TeX.
  95. * Sp::                Inserting blank lines.
  96. * Br::                Inserting paragraph breaks.
  97. * W::                Preventing line breaks.
  98. * Page::            Starting new pages.
  99. * Group::            Holding text together on one page.
  100. * Need::            Keeping text together.
  101. Marking Text Within a Paragraph
  102. * Code::            A literal example of a piece of a program.
  103. * Samp::            A literal example of a sequence of characters.
  104. * File::            The name of a file.
  105. * Kbd::                The names of keys or else characters you type.
  106. * Key::                The conventional name for a key on a keyboard.
  107. * Ctrl::            Indicates the ASCII control character.
  108. * Var::                A variable.
  109. * Dfn::                The introductory or defining use of a term.
  110. * Cite::            The name of a book.
  111. Inserting Braces, `@' and Periods
  112. * Braces Atsigns Periods::    Inserting braces, `@' and periods.
  113. * Dots Bullets Tex::        Inserting dots, bullets and the TeX logo
  114. * Emphasis::            Emphasizing text.
  115. Emphasizing Text
  116. * Emph and Strong::        Emphasizing text.
  117. * Fonts::            Selecting italic, bold or typewriter fonts.
  118. Creating an Info File
  119. * Installing an Info File::    Putting the Info file in the
  120.                 `info' directory.
  121. Catching Mistakes
  122. * Debugging with Info::            Catching errors with info formatting.
  123. * Using the Emacs Lisp Debugger::   Using the Emacs Lisp Debugger
  124. * Debugging with Tex::            Catching errors with TeX formatting.
  125. * Using texinfo-show-structure::    Using `texinfo-show-structure'
  126.                     to catch mistakes.
  127. * Using Occur::                Using `occur' to catch mistakes.
  128. * Running Info-Validate::        Checking for unreferenced nodes.
  129. Finding badly referenced nodes
  130. * Info-Validating a Large File::     Running `Info-validate'
  131.                      on a large file.
  132. * Splitting::                        Splitting a file manually.
  133. Appendices
  134. * Command Syntax::        Details about the syntax.
  135. * Include Files::        Making one printed file out of
  136.                 several Info files.
  137. * TeX Input::            Where TeX finds its `\input' file.
  138. * Sample Permissions::        You may copy GNU Software.
  139. * Ifinfo Permissions::        What to put in the `ifinfo' section.
  140. * Titlepage Permissions::    What to put in the `@titlepage' section.
  141. File: texinfo,  Node: License,  Next: Overview,  Prev: Top,  Up: Top
  142. Licensing Information
  143. *********************
  144.    The programs currently being distributed that relate to Texinfo
  145. include two portions of GNU Emacs, plus two other separate programs
  146. (`texindex' and `texinfo.tex').  These programs are "free"; this means
  147. that everyone is free to use them and free to redistribute them on a
  148. free basis.  The Texinfo related programs are not in the public domain;
  149. they are copyrighted and there are restrictions on their distribution,
  150. but these restrictions are designed to permit everything that a good
  151. cooperating citizen would want to do.  What is not allowed is to try to
  152. prevent others from further sharing any version of these programs that
  153. they might get from you.
  154.    Specifically, we want to make sure that you have the right to give
  155. away copies of the programs that relate to Texinfo, that you receive
  156. source code or else can get it if you want it, that you can change these
  157. programs or use pieces of them in new free programs, and that you know
  158. you can do these things.
  159.    To make sure that everyone has such rights, we have to forbid you to
  160. deprive anyone else of these rights.  For example, if you distribute
  161. copies of the Texinfo related programs, you must give the recipients all
  162. the rights that you have.  You must make sure that they, too, receive or
  163. can get the source code.  And you must tell them their rights.
  164.    Also, for our own protection, we must make certain that everyone
  165. finds out that there is no warranty for the programs that relate to
  166. Texinfo.  If these programs are modified by someone else and passed on,
  167. we want their recipients to know that what they have is not what we
  168. distributed, so that any problems introduced by others will not reflect
  169. on our reputation.
  170.    The precise conditions of the licenses for the programs currently
  171. being distributed that relate to Texinfo are found in the General Public
  172. Licenses that accompany them.  The programs that are part of GNU Emacs
  173. are covered by the GNU Emacs copying terms (*note License:
  174. (emacs)License.), and other programs are covered by licenses that are
  175. contained in their source files.
  176. File: texinfo,  Node: Overview,  Next: Texinfo Mode,  Prev: License,  Up: Top
  177. Overview of Texinfo
  178. *******************
  179.    Texinfo is a documentation system that uses a single source file for
  180. both on-line help and a printed manual.  This means that instead of
  181. writing two different documents, one for the on-line help and the other
  182. for the printed manual, only one document needs to be written.  When
  183. the system is revised, only one file has to be revised.
  184.    Using Texinfo, you can create a document with the normal features of
  185. a book such as chapters, sections, cross references and indices.  The
  186. chapters and sections of the printed manual can be made to correspond
  187. to the nodes of the on-line help.  The cross references and indices can
  188. be used in both the on-line help and in the printed document.  Indices
  189. are generated semi-automatically.  The `GNU Emacs Manual' is a good
  190. example of a Texinfo file.
  191.    To make the printed manual, the Texinfo source file is processed by
  192. the TeX typesetting program; the resulting DVI file can be typeset and
  193. printed as a book.  To make the on-line help, the Texinfo source file
  194. is by processed the `M-x texinfo-format-buffer' command; the resulting
  195. Info file is installed in the `info' directory.
  196.    Since the Texinfo source file is used for a dual task--to create
  197. both the on-line help and the printed manual--it must be written in a
  198. special format that uses @-commands (words preceded by an `@') to
  199. indicate chapters, sections, nodes, examples, index entries and the
  200. like.
  201.    Before writing a Texinfo source file, you should be familiar with the
  202. on-line Info documentation reading program.  (*note info: (info)Info,
  203. for more information.)  If you are writing a document that will be both
  204. on-line and printed, you will need both Info and TeX.
  205.    To make an Info file, you use the `M-x texinfo-format-buffer' command
  206. in GNU Emacs.
  207.    To make a printed manual, you need to use TeX, a powerful,
  208. sophisticated typesetting program written by Donald Knuth.  TeX is
  209. freely distributable. It is written in a dialect of Pascal called WEB
  210. and can be compiled either in Pascal or (by using a conversion program
  211. that comes with the TeX distribution) in C.  (For information about
  212. getting TeX, *note TeX Mode: (emacs)TeX Mode.)
  213.    When TeX processes a Texinfo source file, TeX makes use of a macro
  214. definitions file called `texinfo.tex' that comes with the GNU Emacs
  215. distribution in the `emacs/man' sources directory.  (The first line of
  216. every Texinfo file has a command that says `\input texinfo'; this tells
  217. TeX to use the `texinfo.tex' file.)
  218.    If the `texinfo.tex' file has not already been copied to the
  219. directory which contains the other TeX macro definition files when
  220. Emacs was installed, you will probably want to copy it to that
  221. directory.  Usually, this is the `/usr/lib/tex/macros' directory.  For
  222. more information, *note TeX Input Initialization: TeX Input.
  223.    Documentation for GNU utilities and libraries should be written in
  224. Texinfo format.
  225. * Menu:
  226. * Info File::         Characteristics of the Info file.
  227. * Printed Manual::    Characteristics of the Printed Manual.
  228. * Conventions::       General Syntactic Conventions.
  229. * Short Sample::      A short sample Texinfo file.
  230. File: texinfo,  Node: Info File,  Next: Printed Manual,  Up: Overview
  231. Characteristics of the Info file
  232. ================================
  233.    A Texinfo file can be transformed into a printed manual and an
  234. on-line Info file.
  235.    An on-line Info file is a file formatted so that the Info
  236. documentation reading program can operate on it.  Info files are
  237. divided into pieces called "nodes", each of which contains the
  238. discussion of one topic.  Each node has a name, and contains both text
  239. for the user to read and pointers to other nodes, which are identified
  240. by their names.  The Info program displays one node at a time, and
  241. provides commands with which the user can move to the other nodes to
  242. which the current node points.
  243.    *note info: (info)Info, for more information about using Info.
  244.    Normally, most of the nodes are arranged in a tree which branches
  245. down.  Each node may have any number of child nodes that describe
  246. subtopics of the node's topic.  The names of these child nodes, if any,
  247. are listed in a "menu" within the parent node; this allows certain Info
  248. commands to be used to move to one of the child nodes.  Each child node
  249. records the parent node name, as its `Up' pointer.  Thus, if a node
  250. were at the logical level of a `chapter', its child nodes would be
  251. `sections'; likewise, the child nodes of a section would be subsections.
  252.    The root of the tree is the top node of the file, through which users
  253. enter the file from the Info directory.  By convention, this node is
  254. always called `Top'.  This node normally contains just a brief summary
  255. of the file's purpose, and a large menu through which the rest of the
  256. file is reached.
  257.    Generally you enter the Info file from the top; then you can either
  258. traverse the file systematically by going from node to node or you can
  259. search large menus that correspond to indices and go directly to the
  260. node that has the information you want.
  261.    If you want to read through an Info file in sequence, as if it were a
  262. printed manual, you can get the whole file with the advanced Info
  263. command `g *'.  (*note info: (info)Expert.)
  264.    All the children of any one parent are linked together in a
  265. bidirectional chain of `Next' and `Previous' pointers.  This means that
  266. all the nodes that are logically parallel to sections within a chapter
  267. are all linked together.  Normally the order in this chain is the same
  268. as the order of the children in the parent's menu.  The last child has
  269. no `Next' pointer, and the first child normally has the parent as its
  270. `Previous' pointer (as well as its `Up' pointer, of course).
  271.    Structuring the nodes in a tree is a matter of convention, not a
  272. requirement.  In fact, the `Up', `Previous' and `Next' pointers of a
  273. node can point to any other nodes, and the menu can contain any other
  274. nodes.  The structure of nodes can be any directed graph.  But it is
  275. usually more comprehensible to make it a tree.  Info provides another
  276. kind of pointer between nodes, called a reference, that can be
  277. sprinkled through the text of a node.  This is usually the best way to
  278. represent links that do not fit the tree structure.
  279.    Most often the nodes fall into a strict tree structure that
  280. corresponds to the structure of chapters and sections in the printed
  281. manual.  But there are times when this is not right for the material
  282. being discussed.  Therefore, Texinfo uses separate commands to specify
  283. the node structure of the Info file and the section structure of the
  284. printed manual.  Also, Texinfo requires that you specify menus
  285. explicitly, rather than generate them automatically based on an assumed
  286. tree structure.
  287. File: texinfo,  Node: Printed Manual,  Next: Conventions,  Prev: Info File,  Up: Top
  288. Characteristics of the Printed Manual
  289. =====================================
  290.    A Texinfo file can be formatted and typeset as a printed manual.  The
  291. printed manual will be the same as any other book; it will have a title
  292. page, copyright page, table of contents, and preface as you would
  293. expect, as well as chapters, numbered or unnumbered sections and
  294. subsections, not to mention page headers, cross references and indices.
  295.    Texinfo can be used for writing a book without ever having the
  296. intention of converting it into on-line help.  Texinfo can be used for
  297. writing a novel; and it can even be used to write a memo, although this
  298. application is not recommended since electronic mail is so much easier.
  299.    Texinfo uses the formatting language called TeX for typesetting.  A
  300. file called `texinfo.tex' contains information (definitions or
  301. "macros") that TeX uses when it typesets a Texinfo file.  (The macros
  302. tell TeX how to convert the Texinfo @-commands to TeX commands which
  303. TeX can then process to create the typeset document.) `texinfo.tex'
  304. contains the specifications for printing a document, either with 7 inch
  305. by 9.25 inch pages or with 8.5 inch by 11 inch pages.  (This is 178 mm
  306. by 235 mm or else 216 mm by 280 mm.) Also, by changing the parameters
  307. in `texinfo.tex' you can easily change the size of the printed
  308. document.  In addition, you can readily change the style in which the
  309. printed document is formatted; for example, you can change the sizes and
  310. fonts used, the amount of indentation for each paragraph, the degree to
  311. which words are hyphenated, and the like.  By changing the
  312. specifications, you can make a book look dignified, old and serious, or
  313. light-hearted, young and cheery.
  314.    TeX is very powerful and has a great many features.  Because a
  315. Texinfo file must be able to present information both on a
  316. character-only terminal in Info form and in a typeset book, the
  317. commands that Texinfo supports are necessarily limited.
  318. File: texinfo,  Node: Conventions,  Next: Short Sample,  Prev: Printed Manual,  Up: Overview
  319. General Syntactic Conventions
  320. =============================
  321.    Texinfo files contain a strictly limited set of constructs.  The
  322. strict limits make it possible for Texinfo files to be understood both
  323. by TeX and by the code which converts them into Info files.
  324.    All ASCII printing characters except `@', `{' and `}' can appear in
  325. body text in a Texinfo file and stand for themselves.  `@' is the
  326. escape character which introduces commands.  `{' and `}' should be used
  327. only to surround arguments to certain commands.  `{' and `}' appearing
  328. anywhere else will be treated by TeX as a grouping but treated by the
  329. code that produces an Info file as themselves; this inconsistency is
  330. undesirable, so don't let it occur.  To put one of these special
  331. characters into the document, put an `@' character in front of it.  For
  332. example, you would insert `@@', `@{', and `@}'.
  333.    It is customary in TeX to use doubled single-quote characters to
  334. begin and end quotations, ```' like these `'''.  This convention should
  335. be followed in Texinfo files.  Also, three hyphens in a row, `---', are
  336. used for a dash--like this.  In TeX, a single or even a double hyphen
  337. produces a dash that is shorter than you want.
  338.    TeX ignores the line-breaks in the input text, except for blank
  339. lines, which separate paragraphs.  Info generally preserves the line
  340. breaks that are present in the input file.  Therefore, break the lines
  341. in the Texinfo file the way you want them to appear in the output Info
  342. file, and let TeX take care of itself.
  343.    Since Info does not normally refill paragraphs when it processes
  344. them, a line with @-commands in it will sometimes look bad after Info
  345. has run on it.  To cause Info to refill the paragraph after finishing
  346. with the other processing, you need to put the command `@refill' at the
  347. end of the paragraph. (*Note Refilling paragraphs and Preventing
  348. indentation: Refilling & Noindent.)
  349.    To prevent a paragraph from being indented in the printed manual,
  350. put the command `@noindent' on a line by itself before the start of the
  351. text that should not be indented.
  352.    If you mark off a region of the Texinfo file with the `@iftex' and
  353. `@end iftex' commands so that the region will appear only in the
  354. printed copy, you can use TeX commands that cannot be used in the Info
  355. file.
  356.    In order to be made into a printed manual, a Texinfo file *must*
  357. begin with lines that looks like
  358.      \input texinfo   @c -*-texinfo-*-
  359.      @setfilename INFO-FILE-NAME
  360.      @settitle NAME OF MANUAL
  361. The `\input texinfo' line tells TeX to use the `texinfo.tex' file.
  362. This line is usually followed by a start-of-header line (not shown
  363. here) and then by the `@setfilename INFO-FILE-NAME' and `@settitle NAME
  364. OF MANUAL' lines.  These two lines are needed to provide a name for the
  365. Info file and to specify the name used on the left-hand page headers of
  366. the printed manual.
  367.    The two lines that contain the `@setfilename' and `@settitle'
  368. commands usually are sandwiched between the start-of-header line and the
  369. end-of-header line. (*Note Start-of-Header::, for more information.)
  370. The start-of-header and end-of-header lines are needed if you are going
  371. to run TeX or Info on just part of a file.
  372. File: texinfo,  Node: Short Sample,  Prev: Conventions,  Up: Overview
  373. A Short Sample Texinfo File
  374. ===========================
  375.    A Texinfo file looks like the following, which is a complete but
  376. very short Texinfo file.  The `@comment' command introduces comments
  377. that will not appear in either the Info file or the printed manual;
  378. they are for the person who reads the Texinfo file.
  379.    The first part of the file, from `\input texinfo' through to `@end
  380. titlepage', looks more intimidating than it is.  Most of the material
  381. is standard boilerplate; when you write a manual, you just put in the
  382. name of your own manual in this section.
  383.    All the commands that tell TeX how to typeset the printed manual and
  384. tell `texinfo-format-buffer' how to create an Info file are preceded by
  385. `@'; thus, `@node' indicates a node and `@chapter' indicates the start
  386. of a chapter.
  387.      \input texinfo   @c -*-texinfo-*-
  388.      @setfilename name-of-texinfo-file
  389.      @settitle Name of Manual
  390.      @setchapternewpage odd
  391.      
  392.      @ifinfo
  393.      @comment The following line inserts the copyright notice
  394.      @comment into the Info file.
  395.      Copyright @copyright{} 1988 Free Software Foundation, Inc.
  396.      @end ifinfo
  397.      
  398.      @comment The titlepage section does not appear in the Info file.
  399.      @titlepage
  400.      @sp 10
  401.      @comment The title is printed in a large font.
  402.      @center @titlefont{Sample Title}
  403.      
  404.      @comment  The following two commands start the copyright page
  405.      @comment  for the printed manual.  This will not appear in the Info file.
  406.      @page
  407.      @vskip 0pt plus 1filll
  408.      Copyright @copyright{} year copyright-owner
  409.      @end titlepage
  410.      
  411.      @comment The Top node contains the master menu for the Info file.
  412.      @comment This appears only in the Info file, not the printed manual.
  413.      
  414.      @node    Top,       First Chapter, (dir),    (dir)
  415.      @comment node-name, next,          previous, up
  416.      
  417.      @menu
  418.      * First Chapter::    The first chapter is the
  419.                           only chapter in this sample.
  420.      @end menu
  421.      
  422.      @node     First Chapter,     , Top,      Top
  423.      @comment  node-name,     next, previous, up
  424.      @chapter First Chapter
  425.      @cindex Reference to First Chapter
  426.      
  427.      This is the contents of the first chapter.
  428.      
  429.      Here is a numbered list.
  430.      
  431.      @enumerate
  432.      @item
  433.      This is the first item.
  434.      
  435.      @item
  436.      This is the second item.
  437.      @end enumerate
  438.      
  439.      The @kbd{M-x texinfo-format-buffer} command transforms a Texinfo file
  440.      like this into an Info file; and @TeX{} typesets it for a printed
  441.      manual.
  442.      
  443.      @node    Concept Index,    ,  Previous Node, Top
  444.      @comment node-name,    next,  previous,      up
  445.      @unnumbered Concept Index
  446.      
  447.      @printindex cp
  448.      
  449.      @contents
  450.      @bye
  451.    Here is what the contents of the first chapter of the sample look
  452. like:
  453.      This is the contents of the first chapter.
  454.      Here is a numbered list.
  455.        1. This is the first item.
  456.        2. This is the second item.
  457.      The `M-x texinfo-format-buffer' command transforms a Texinfo file
  458.      like this into an Info file; and TeX typesets it for a printed
  459.      manual.
  460. File: texinfo,  Node: Texinfo Mode,  Next: Beginning a File,  Prev: Overview,  Up: Top
  461. Using Texinfo Mode
  462. ******************
  463.    In GNU Emacs, Texinfo mode is a major mode for editing Texinfo files.
  464. This means that Emacs has commands and features especially designed for
  465. working with Texinfo files.  Like all other Emacs features, you can
  466. customize or enhance these as you wish.  In particular, the keybindings
  467. are very easy to change.  The keybindings described here are the
  468. default or standard ones.
  469.    The major features of Texinfo mode are:
  470.    * Paragraph filling control.
  471.    * A command to show the structure of the file.
  472.    * Pre-defined keystroke commands to insert commonly used strings of
  473.      text.
  474.    * Formatting a part of a file for Info, rather than the whole file.
  475.    In general, in Texinfo mode, the GNU Emacs editing commands are like
  476. those in text-mode.  The major difference is that the paragraph
  477. separation variable and syntax table are set up so expression commands
  478. skip Texinfo bracket groups.  This means, for example, that the `M-q'
  479. (`fill-paragraph') command will refill a paragraph but not the
  480. @-command on a line adjacent to it.
  481.    By convention, the Texinfo file name shall end with the extension
  482. `.texinfo' so that Emacs knows to use Texinfo mode for editing it.
  483. * Menu:
  484. * Info on a Region::        Formatting part of a file for Info.
  485. * Showing the Structure::    Showing the structure of a file.
  486. * Inserting::            Inserting frequently used commands.
  487. File: texinfo,  Node: Info on a Region,  Next: Showing the Structure,  Prev: Texinfo Mode,  Up: Texinfo Mode
  488. Formatting a Region for Info
  489. ============================
  490.    To see what part of a Texinfo file will look like after it has been
  491. transformed into an Info file, use the command `C-c C-f'
  492. (`texinfo-format-region').  This command formats the current region of
  493. the Texinfo file for Info and writes it to a temporary buffer called
  494. `*Info Region*'.
  495.    For `texinfo-format-region' to work, the file *must* include a line
  496. that has `@setfilename' in its header.
  497.    The command is:
  498. `C-c C-f'
  499.      texinfo-format-region
  500. File: texinfo,  Node: Showing the Structure,  Next: Inserting,  Prev: Info on a Region,  Up: Texinfo Mode
  501. Showing the Structure of a File
  502. ===============================
  503.    You can show the structure of a Texinfo file by using the `C-c C-s'
  504. command (`texinfo-show-structure').  This command shows the structure
  505. of a Texinfo file by listing the lines with the @-commands for `@node',
  506. `@chapter', `@section' and the like.  These lines are displayed in
  507. another window called the `*Occur*' window.  In that window, you can
  508. position the cursor over one of the lines and use the `C-c C-c' command
  509. (`occur-mode-goto-occurrence'), to jump to the corresponding spot in
  510. the Texinfo file.
  511.    The two commands are:
  512. `C-c C-s'
  513.      texinfo-show-structure
  514. `C-c C-c'
  515.      occur-mode-goto-occurrence
  516.    Often, when you are working on a manual, you will be interested only
  517. in the structure of the current chapter.  In this case, you can mark
  518. off the region of the buffer that you are interested in with the `C-x n'
  519. (`narrow-to-region') command and `texinfo-show-structure' will work on
  520. only that region.  (To see the whole buffer again, use `C-x w'
  521. (`widen').)
  522. File: texinfo,  Node: Inserting,  Prev: Showing the Structure,  Up: Texinfo Mode
  523. Inserting Frequently Used Commands
  524. ==================================
  525.    Texinfo mode provides commands that insert various frequently used
  526. @-commands into the buffer.  You can use these commands to save
  527. keystrokes.  And you can insert balanced curly braces with the `M-{'
  528. command, (`texinfo-insert-braces') and later use the `M-}' command
  529. (`up-list') to move forward past the closing brace.
  530.    The special commands are invoked by typing `C-c' twice and then the
  531. first letter of the @-command.
  532. `C-c C-c c'
  533.      texinfo-insert-@code
  534. `C-c C-c d'
  535.      texinfo-insert-@dfn
  536. `C-c C-c e'
  537.      texinfo-insert-@end
  538. `C-c C-c i'
  539.      texinfo-insert-@item
  540. `C-c C-c n'
  541.      texinfo-insert-@node
  542. `C-c C-c s'
  543.      texinfo-insert-@samp
  544. `C-c C-c v'
  545.      texinfo-insert-@var
  546. `M-{'
  547.      texinfo-insert-braces
  548. `M-}'
  549.      up-list
  550.    This list was generated by analyzing the frequency with which
  551. commands were used in the `GNU Emacs Manual' and the `GDB Manual'.  If
  552. you wish to add your own insert commands, you can bind a keyboard macro
  553. to a key, use abbreviations or extend the code in `texinfo.el'.
  554. File: texinfo,  Node: Beginning a File,  Next: Ending a File,  Prev: Texinfo Mode,  Up: Top
  555. Beginning a Texinfo File
  556. ************************
  557.    Various pieces of information have to be provided to Texinfo at the
  558. beginning of a Texinfo file, such as the name of the file, the title of
  559. the document and the like.  Generally, the beginning of a Texinfo file
  560. has four parts:
  561.   1. The header, marked by start-of-header and end-of-header lines, that
  562.      includes the commands for naming the Texinfo file and telling TeX
  563.      what definitions' file to use when processing the file.
  564.   2. A section, marked by the `@ifinfo' and `@end ifinfo' commands,
  565.      that contains a short statement of what the file is about, the
  566.      copyright notice and copying permissions. This section appears
  567.      only in the Info file.
  568.   3. A section, marked by the `@titlepage' and `@end titlepage'
  569.      commands, that contains the title page, the copyright page and
  570.      copying permissions.  This section appears only in the printed
  571.      manual.
  572.   4. The `Top' node that contains an extensive menu for the whole Info
  573.      file.  The contents of this node only appear in the Info file.
  574.    If the Texinfo file has a section containing licensing information
  575. and a warranty disclaimer, that section usually follows the `Top' node.
  576. The licensing section will be followed by a preface or else by the
  577. first chapter of the manual.
  578.    Since the copyright notice and the copying permissions are in
  579. sections that appear only in the Info file or only in the printed
  580. manual, this information has to be repeated twice.
  581.    The following sample shows what is needed.
  582.      \input texinfo   @c -*-texinfo-*-
  583.      @comment %**start of header (This is for running Texinfo on a region.)
  584.      @setfilename name-of-texinfo-file
  585.      @settitle Name of Manual
  586.      @setchapternewpage odd
  587.      @comment %**end of header (This is for running Texinfo on a region.)
  588.      
  589.      @ifinfo
  590.      This file documents ...
  591.      
  592.      Copyright @copyright{} year  copyright-owner
  593.      
  594.      Permission is granted to ...
  595.      @end ifinfo
  596.      
  597.      @titlepage
  598.      @sp 10
  599.      @center @titlefont{Name of Manual When Printed}
  600.      @sp 2
  601.      @center Subtitle, If Any
  602.      @sp 2
  603.      @center Author
  604.      
  605.      @comment  The following two commands start the copyright page.
  606.      @page
  607.      @vskip 0pt plus 1filll
  608.      Copyright @copyright{} year copyright-owner
  609.      
  610.      Published by ...
  611.      
  612.      Permission is granted to ...
  613.      @end titlepage
  614.      
  615.      
  616.      @node Top, Overview, (dir), (dir)
  617.      
  618.      @menu
  619.      * First Chapter::        The first chapter is usually an overview.
  620.      * Second Chapter::        ...
  621.        <many more menu items here>
  622.      @end menu
  623.      
  624.      @node    First Chapter, Second Chapter, top,      top
  625.      @comment node-name,     next,           previous, up
  626.      @chapter First Chapter
  627.      @cindex Reference to First Chapter
  628. * Menu:
  629. * Header::            Necessary first lines.
  630. * Permissions for Info::    Copyright notice and copying permissions.
  631. * Titlepage & Copyright Page::    Printed title and copyright pages.
  632. * Top Node::            The top node and master menu.
  633. * License and Distribution::     The importance of the license.
  634. File: texinfo,  Node: Header,  Next: Permissions for Info,  Prev: Beginning a File,  Up: Beginning a File
  635. The Texinfo File Header
  636. =======================
  637.    Texinfo files start with at least three lines that provide Info and
  638. TeX with necessary information.  If you want to run TeX on just a part
  639. of the Texinfo File, you also have to mark these heading lines with
  640. start-of-header and end-of-header lines.
  641. * Menu:
  642. * First Line::            The first line of a Texinfo file.
  643. * Start-of-Header::        Identifying the start of the header.
  644. * Setfilename::            Specifying the name of the Info file.
  645. * Settitle::            Specifying the title used by the headings.
  646. * Setchapternewpage::        Starting chapters on odd numbered pages.
  647. * End-of-Header::        Identifying the end of the header.
  648. File: texinfo,  Node: First Line,  Next: Start-of-Header,  Prev: Header,  Up: Header
  649. The First Line of a Texinfo File
  650. --------------------------------
  651.    Every Texinfo file that is to be the top-level input to TeX must
  652. begin with a line that looks like this:
  653.      \input texinfo   @c -*-texinfo-*-
  654. The line serves two functions:
  655.   1. When the file is processed by TeX, it loads the macros needed for
  656.      processing a Texinfo file.  These are in a file called
  657.      `texinfo.tex' which is usually located in the
  658.      `/usr/lib/tex/macros' directory.
  659.   2. When the file is edited in GNU Emacs, it causes Texinfo mode to be
  660.      used.
  661.    The `\input texinfo' line should be followed by the start-of-header
  662. line.  This makes it possible for the command for running TeX on a part
  663. of the Texinfo file (`texinfo-hardcopy-region') to operate.  The reason
  664. for this is that the `texinfo-hardcopy-region' command will look on the
  665. line preceding the start-of-header line for the `\input texinfo' line.
  666. File: texinfo,  Node: Start-of-Header,  Next: Setfilename,  Prev: First Line,  Up: Header
  667. `start-of-header'
  668. -----------------
  669.    The start-of-header line should immediately follow the first line of
  670. the Texinfo file.
  671.    The `texinfo-hardcopy-region' command will look at the line
  672. preceding the start-of-header line to find the `\input texinfo' line.
  673.    Usually, the start-of-header line looks like this:
  674.      @comment %**start of header (This is for running Texinfo on a region.)
  675.    The reason for the odd string of characters (`%**') is so that the
  676. `texinfo-hardcopy-region' command does not accidently find something
  677. that it shouldn't when it is looking for the header.
  678.    In the default configuration, the phrase `(This is for running
  679. Texinfo on a region.)' is not needed and is just included to make it
  680. easier for someone reading the Texinfo file.
  681.    The start-of-header line and the end-of-header line are Texinfo mode
  682. variables that you can change.
  683. File: texinfo,  Node: Setfilename,  Next: Settitle,  Prev: Start-of-Header,  Up: Header
  684. @setfilename
  685. ------------
  686.    In order to be made into an Info file, a Texinfo file must contain a
  687. line that looks like this:
  688.      @setfilename INFO-FILE-NAME
  689. This line specifies the name of the Info file to be generated.  In
  690. fact, there can be other things in the file before this line, but they
  691. are ignored in the generation of an Info file.  The `@setfilename' line
  692. is ignored when a printed manual is generated.
  693. File: texinfo,  Node: Settitle,  Next: Setchapternewpage,  Prev: Setfilename,  Up: Header
  694. @settitle
  695. ---------
  696.    In order to be made into a printed manual file, a Texinfo file must
  697. contain a line that specifies the title of the manual.  Texinfo uses
  698. this information during printing to put the title on every other page
  699. as a heading; Texinfo puts the current chapter title on the other pages.
  700. Texinfo can find the name of the chapter title from the information
  701. provided by the `@chapter' command, but you must tell it the manual
  702. title with `@settitle':
  703.      @settitle TITLE
  704. This command, on a line by itself, causes TITLE to be used for the
  705. headings.  Usually, you will use the same words for the title on the
  706. title page and for the title specified by this command for the
  707. headings, but the two could be different.  For example, the title on
  708. the title page may be longer than the title specified by the `settitle'
  709. command.
  710.    The `@settitle' command should precede everything that generates
  711. actual output.
  712. File: texinfo,  Node: Setchapternewpage,  Next: End-of-Header,  Prev: Settitle,  Up: Header
  713. @setchapternewpage
  714. ------------------
  715.    Conventionally, chapters start on the page on the right hand side of
  716. a book; and the right hand page has an odd number.  To make sure that
  717. Texinfo does this, you can use the command `@setchapternewpage'.  For
  718. example, to cause each chapter to start on a fresh odd-numbered page:
  719.      @setchapternewpage odd
  720.    Page numbering is turned on by the `@end titlepage' command, so the
  721. `@setchapternewpage' should come before it.  Although it can occur
  722. anywhere in the beginning of the file, it is most convenient to put it
  723. in this location.
  724. File: texinfo,  Node: End-of-Header,  Prev: Setchapternewpage,  Up: Header
  725. `end-of-header'
  726. ---------------
  727.    The end-of-header line should follow the line containing the
  728. `@setchapternewpage' command.
  729.    Usually, the end-of-header line looks like this:
  730.      @comment %**end of header (This is for running Texinfo on a region.)
  731.    In the default configuration, the phrase `(This is for running
  732. Texinfo on a region.)' is not needed and is just included to make it
  733. easier for someone reading the Texinfo file.
  734.    The reason for the odd string of characters (`%**') is so that the
  735. `texinfo-hardcopy-region' command does not accidently find something
  736. that it shouldn't when it is looking for the header.
  737.    The start-of-header line and the end-of-header line are Texinfo mode
  738. variables that you can change.
  739. File: texinfo,  Node: Permissions for Info,  Next: Titlepage & Copyright Page,  Prev: Header,  Up: Beginning a File
  740. Copying Permissions for Info
  741. ============================
  742.    Since the title page and the copyright page appear only in the
  743. printed copy of the manual, the same information has to inserted in a
  744. section that appears only in the Info file.  This section usually
  745. contains a brief description of the contents of the Info file, a
  746. copyright notice and copying permissions.
  747.    The copyright notice should read:
  748.      Copyright YEAR COPYRIGHT-OWNER
  749. and be put on a line by itself.
  750.    Standard text for the copyright permissions is contained in the
  751. appendix.  *Note Ifinfo Permissions::, for the complete text.
  752. File: texinfo,  Node: Titlepage & Copyright Page,  Next: Top Node,  Prev: Permissions for Info,  Up: Beginning a File
  753. The Title and Copyright Pages
  754. =============================
  755.    The title and copyright pages appear in the printed manual, but not
  756. in the Info file.  Because of this, it is possible to use a couple of
  757. slightly obscure TeX typesetting commands that could not be used in an
  758. Info file.  In addition, this part of the beginning of a Texinfo file
  759. contains the text of the copying permissions that will appear in the
  760. printed manual.
  761. * Menu:
  762. * Titlepage::            Creating a title page for the printed manual.
  763. * Center::            Centering a line.
  764. * Copyright & Printed Permissions::     Inserting the copyright notice
  765.                     and printed permissions.
  766. File: texinfo,  Node: Titlepage,  Next: Center,  Prev: Titlepage & Copyright Page,  Up: Titlepage & Copyright Page
  767. @titlepage
  768. ----------
  769.    Start the material for the title page and following copyright page
  770. with `@titlepage' on a line by itself and end it with `@end titlepage'
  771. on a line by itself.  The title page and copyright page material
  772. appears only in the printed manual, not in the Info file.
  773.    Also, the `@end titlepage' command starts a new page and turns on
  774. page numbering (generation of headings).  Therefore, all the material
  775. that you want to appear on unnumbered pages should be put between the
  776. `@titlepage' and `@end titlepage' commands.  By using the `@page'
  777. command you can force a page break within the region delineated by the
  778. `@titlepage' and `@end titlepage' commands and create more than one
  779. unnumbered page.  This is how the copyright page is produced.
  780.    To select a large font suitable for the title itself, you can use the
  781. command `@titlefont'.  For example:
  782.      @center @titlefont{Texinfo}
  783.    Also, you can use `@sp' commands to adjust vertical spacing.  For
  784. example:
  785.      @sp 2
  786. In the sample, the spacing was chosen to fit an 8 1/2 by 11 inch manual.
  787. File: texinfo,  Node: Center,  Next: Copyright & Printed Permissions,  Prev: Titlepage,  Up: Titlepage & Copyright Page
  788. @center
  789. -------
  790.    A line containing `@center TEXT' produces a line of output
  791. containing TEXT, centered between the margins.
  792. File: texinfo,  Node: Copyright & Printed Permissions,  Prev: Center,  Up: Titlepage & Copyright Page
  793. The Copyright Page and Printed Permissions
  794. ------------------------------------------
  795.    By international treaty, the copyright notice for a book should
  796. either be on the title page or on the back of the title page.  Other
  797. locations in a book are not official and do not provide copyright
  798. protection.  The copyright notice should include the year followed by
  799. the name of the person or organization who has the copyright.
  800.    When the copyright notice is on the back of the title page, the page
  801. is not numbered.  Therefore, in Texinfo, the information on the
  802. copyright page should be within the region delineated by the
  803. `@titlepage' and `@end titlepage' commands.
  804.    To cause a page break, the `@page' command is used.  In the sample,
  805. the `@page' command is followed by the somewhat mysterious line that
  806. reads: `@vskip 0pt plus 1filll'.  This is a line that uses TeX commands
  807. to push the copyright notice and the other text on the copyright page
  808. towards the bottom of the page.  The `@vskip' command means to skip
  809. lines and put in white space.  The `0pt plus 1filll' means to put in
  810. zero points of mandatory white space, and as much optional white space
  811. as needed.  Note the use of three `l's in the word `filll'; this is the
  812. correct use in TeX.
  813.    The `@copyright{}' command generates a `c' inside a circle.  The
  814. copyright notice itself has the following legally defined sequence:
  815.      Copyright (C) YEAR COPYRIGHT-OWNER
  816.    It is customary to put information on how to get a manual after the
  817. copyright notice (the address of the Free Software Foundation, for
  818. example) and the permissions.
  819.    Note that the permissions have to be repeated here as well as in the
  820. `ifinfo' section that immediately follows the header since this section
  821. appears only in the printed manual and the `ifinfo' section appears
  822. only in the Info file.
  823.    Standard text for the permissions appears in the appendix.  *Note
  824. Sample Permissions::.
  825. File: texinfo,  Node: Top Node,  Next: License and Distribution,  Prev: Titlepage & Copyright Page,  Up: Beginning a File
  826. The Top Node and Master Menu
  827. ============================
  828.    The `Top' node contains an extensive, master menu for the whole Info
  829. file.  The contents of this node appear only in the Info file.  Nothing
  830. in this node should appear in the printed file.  Since a node line by
  831. itself and a menu by itself are not printed, the contents of this node
  832. do not have to be within a region delineated by `@ifinfo' and `@end
  833. ifinfo' commands.  However, any text within the node should be marked
  834. off in that manner.  You may want to put a short summary before the
  835. master menu inside a region delineated by `@ifinfo' and `@end ifinfo'
  836. commands.  Usually, the `Previous' and `Up' nodes refer to the top
  837. level directory of the whole Info system, with pointers to `(dir)'.
  838.    Generally, the top menu is divided into parts.
  839.    * The first part contains the major nodes in the Texinfo file: the
  840.      nodes for the chapters, chapter-like sections and the major
  841.      appendices.
  842.    * The second part contains entries for the indices.  In an Info
  843.      file, it is very useful to have indices here at the beginning of
  844.      the file in the top node rather than at the end, as in a printed
  845.      book.
  846.    * The third and subsequent parts contain a listing of the other,
  847.      lower level nodes, often ordered by chapter.  This way, an
  848.      inquirer can go directly to a particular node if he or she is
  849.      searching for specific information.  (These nodes are not
  850.      required; use them if you think they are a convenience.)
  851.    Each section in the menu can be introduced a descriptive line.  So
  852. long as the line does not begin with an asterisk, it will not be
  853. treated as a menu item.  (*Note Making Menus: Menu, for more
  854. information.)
  855.    For example, the Top node of this manual looks like this (but with
  856. many more entries):
  857.      @node Top, Overview, (dir), (dir)
  858.      
  859.      @menu
  860.      * Overview::                    What is Texinfo?
  861.      * Texinfo Mode::                Special features in GNU Emacs.
  862.      ...
  863.      
  864.      Indices, nodes containing large menus
  865.      
  866.      * Command Index::               An item for each @-command.
  867.      * Concept Index::               An item for each concept.
  868.      
  869.      A detailed node listing
  870.      
  871.      Overview
  872.      * Info File::                   Characteristics of the Info file.
  873.      * Printed Manual::              Characteristics of the printed manual.
  874.      
  875.      Using Texinfo Mode
  876.      * Info on a Region::            Formatting a region for Info.
  877.      * Showing the Structure::       Showing the structure of a file.
  878.      ...
  879.      ...
  880. File: texinfo,  Node: License and Distribution,  Prev: Top Node,  Up: Beginning a File
  881. Licensing and Distribution Information
  882. ======================================
  883.    If the Texinfo file has a section containing the "General Public
  884. License" and the distribution information and a warranty disclaimer,
  885. this section usually follows the `Top' node.  The licensing and
  886. distribution information and the disclaimer are followed by a preface
  887. or else by the first chapter of the manual.
  888.    The licensing agreement is very important to Project GNU
  889. documentation and software.  Without it, you may find that you can no
  890. longer get the software or its documentation.  This sounds paradoxical,
  891. but the state of the world is such that documentation and software that
  892. does not have a "restrictive" license to make them freely distributable
  893. may be lost to the public.  This has happened.
  894.    For a good example of the text that could be used for the
  895. Distribution, General Public License and NO WARRANTY sections of your
  896. document, see the latest version of the `GNU Emacs Manual'.
  897.    Although a preface is not a required part of a Texinfo file, it is
  898. very helpful.  Ideally, it should state clearly and concisely what the
  899. file is about and who would be interested in reading it.  In general,
  900. the preface would follow the licensing and distribution information,
  901. although sometimes people put it earlier in the document.  Usually, a
  902. preface is put in an `@unnumbered' section.  (*Note Unnumbered and
  903. Appendix::.)
  904. File: texinfo,  Node: Ending a File,  Next: Structuring,  Prev: Beginning a File,  Up: Top
  905. Ending a Texinfo File
  906. *********************
  907.    The end of a Texinfo file should include the indices, the commands to
  908. generate detailed and summary tables of contents and the @-command that
  909. tells TeX that it has reached the end of the file.
  910.    For example, a Texinfo file might be ended as follows:
  911.      @node    Concept Index,     , Previous Node, Top
  912.      @comment node-name,     next, previous,      up
  913.      @unnumbered Concept Index
  914.      
  915.      @printindex cp
  916.      
  917.      @contents
  918.      @bye
  919.    The `@bye' command should be on a line by itself and every Texinfo
  920. file must end with such a line.  This command terminates TeX processing
  921. and forces out unfinished pages.
  922. * Menu:
  923. * Contents::        Generating a table of contents
  924. * Indices::        Generating, sorting and printing indices
  925. File: texinfo,  Node: Contents,  Next: Indices,  Up: Ending a File
  926. Generating a Table of Contents
  927. ==============================
  928.    The commands `@chapter', `@section', etc., supply the information to
  929. make up a table of contents, but they do not cause an actual table to
  930. be generated.  To do this, you must use the commands `@contents' and
  931. `@summarycontents'.
  932. `@contents'
  933.      The table of contents command outputs (into a printed manual) a
  934.      complete table of contents, based on the `@chapter', `@unnumbered'
  935.      and other sectioning commands.  This command should be used on a
  936.      line by itself.
  937. `@summarycontents'
  938.      The summary contents command generates a summary table of contents
  939.      that lists only the chapters (and appendices and unnumbered
  940.      chapters); sections, subsections and subsubsections are omitted.
  941.      This command should be used on a line by itself.  Only large
  942.      manuals need a summary table of contents.
  943.    You can use either one of these commands, or both.  Each command
  944. automatically generates a chapter-like heading at the top of the page.
  945. Tables of contents should be generated at the very end of the manual,
  946. just before the `@bye' command; the tables of contents commands should
  947. follow any indices that are output, so that the indices will appear in
  948. the contents.
  949.      INDICES...
  950.      @summarycontents
  951.      @contents
  952.      @bye
  953.    The commands `@contents' and `@summarycontents' are ignored when an
  954. Info file is being generated.
  955.